package com.yupi.yuapiclientsdk;


import com.yupi.yuapiclientsdk.client.YuApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 通过yuapi.client拿到客户端YuApiClientConfig，然后返回
 */
@Configuration
@ConfigurationProperties("yuapi.client")
@Data
@ComponentScan
public class YuApiClientConfig {
    private String accessKey;
    private String secretKey;

//    将YuApiClient定义为bean，可被componentScan扫描到
    @Bean
    public YuApiClient yuApiClient(){
        return new YuApiClient(accessKey, secretKey);
    }

}
